﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using C4F.DevKit.Calendar.Components;

namespace C4F.DevKit.Calendar.Samples
{
    public partial class ImportAppointmentDialog : Form
    {
        private SelectAppointmentDialog _selectDialog;

        public ImportAppointmentDialog(SelectAppointmentDialog selectDialog, string filePath)
        {
            InitializeComponent();

            _selectDialog = selectDialog;
            calendarService1.CalendarFilePath = filePath;
            appointmentsList1.CalendarService = calendarService1;
            appointmentsList1.RefreshList();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnImport_Click(object sender, EventArgs e)
        {
            _selectDialog.Import(appointmentsList1.SelectedAppointment);
            Close();
        }
    }
}
